import 'package:imperius_insights/entity/project.dart';

///
/// 判定一个状态是否是从前一天顺延过来的，用于判定还未及时改的case
/// todayActualStaging 当天的状态
/// previousExpectedEarlyStaging 符合前一天计划内的最初的状态
bool couldStagingContinuesFromPreviousDay(Staging todayActualStaging, Staging previousExpectedEarlyStaging) {
  // 已经排期项目，当天刚开始进入开发
  if (todayActualStaging == Staging.Scheduled) {
    return previousExpectedEarlyStaging == Staging.Scheduled
        || previousExpectedEarlyStaging == Staging.Unset;
  }

  // 已提测项目，今天刚要开始测试
  if (todayActualStaging == Staging.PendingToTest) {
    return previousExpectedEarlyStaging == Staging.Develop
    || previousExpectedEarlyStaging == Staging.PendingToTest;
  }

  // 已提测项目，今天刚要开始测试
  if (todayActualStaging == Staging.PendingToTest) {
    return previousExpectedEarlyStaging == Staging.Develop
        || previousExpectedEarlyStaging == Staging.PendingToTest;
  }
  return false;
}